import allure
from appium.webdriver.common.appiumby import AppiumBy

from tests.app.pages.group_chat_setup_page import GroupChatSetupPage
from tests.app.pages.wecom import Wecom


class GroupChatPage(Wecom):
    __GROUP_CHAT_SETUP = AppiumBy.XPATH, "//*[@resource-id = 'android:id/content']/*[position()=1]/*[position()=1]/*[position()=1]/*[position()=2]/*[position()=2]/*[position()=1]"

    @allure.step("跳转到群聊设置页面")
    def goto_group_chat_setup_page(self):
        self.find_and_click(*self.__GROUP_CHAT_SETUP)
        return GroupChatSetupPage(self.driver)
